package com.tvein.sanguo.room.model
{
	//flash
	//pureMVC
	import org.puremvc.as3.multicore.interfaces.IProxy;
	import org.puremvc.as3.multicore.patterns.proxy.Proxy;
	//custom
//
	public class SystemProxy extends Proxy implements IProxy
	{
		public static const NAME:String = "SystemProxy";
		
		public function SystemProxy()
		{
			super(NAME);
		}
		
		//Custom
		//Room
		private var _roomList:Array = new Array();
		
		public function set roomList(value:Array) : void
        {
            _roomList.push(value);
        }
		
		public function get roomList() : Array
        {
            return _roomList;
        }

		private var _srcList:Array = new Array();
		
		public function srcListAdd(value:String) : void
        {
			var srcTest:Boolean = false;
			
			for (var i:int = 0; i < _srcList.length; i++)
			{
				if (_srcList[i] == value)
				{
					srcTest = true;
					break;
				}	
			}
			
			if (!srcTest)
			{
				_srcList.push(value);
			}
        }
		
		public function srcListGet() : Array
        {
            return _srcList;
        }
		
		//config
		private var _config:Array = new Array();
		//Source Server
		private var _srcServer:String;
		//Sound Effect Volum
		private var _effectVol:Number;
		
		override public function onRegister() : void
        {
			_effectVol = 100;
			_config["effectVol"] = 100;
        }
		
		public function get config() : Array
		{
			return _config;
		}
		
		public function set srcServer(value:String) : void
		{
			_srcServer = value;
			_config["srcServer"] = value;
		}
		
		public function get srcServer() : String
		{
			return _srcServer;
		}
		
		public function set effectVol(value:Number) : void
		{
			_effectVol = value;
			_config["effectVol"] = value;
		}
		
		public function get effectVol() : Number
		{
			return _effectVol;
		}
	}
}